compress: break identical-rejection retry death-loops - #103
Open
ranxianglei wants to merge 1 commit into
Open
Conversation
Session 01a02542 (pi host, qwen3.8-27b via local vLLM/SGLang) re-submitted the SAME rejected compress call 3853 times over 5h11m (~4.9s/call) after every compressible range was consumed. Driver: the min-gate error ended with 'retry with startId/endId set to active block IDs in that span' — a literal retry instruction that weak models follow verbatim while the 'Nothing to do' half is ignored, with no dedup guard anywhere. Track identical consecutive gate rejections per range signature in CompressionState.rejections (optional field, bounded 8-entry FIFO, backward compatible with old persisted states). From the 2nd identical rejection the gate message becomes terminal: states the count, says re-submitting will keep failing, and tells the model to answer the user instead — no retry guidance of any kind. First rejections keep their actionable advice, with the liveHint rephrased to drop the word 'retry' (block-to-block distillation is still offered as the one useful action).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incident
pi session
01a02542(qwen3.8-27b via local vLLM/SGLang, billion-context-pi 0.1.43 + acp-kernel 0.0.30) entered a compress retry death-loop:Fix
CompressionState.rejections(new optional field; bounded 8-entry FIFO of{ spec, count }; keyed on the range signature startRef..endRef list; backward compatible — old persisted states start counting from 1, cloned bycloneState).Tests
tests/compress-rejection-loop.test.ts(4 cases): first rejection keeps guidance + records count; identical 2nd/3rd rejections flip to terminal (asserts the message contains "rejected N times" and contains NO retry/re-issue/acp_status guidance); different range gets its own counter; caller state not mutated; legacy state without the field counts from 1.Full pre-flight:
tsc --noEmitclean, 395 tests pass, build OK.Blast radius
Pure kernel gate change — both adapters (billion-context-pi, billion-context-omp) pick it up on their next kernel pin bump. The omp adapter's compress tool needs no change (it forwards kernel errors verbatim).